package com.fsnbigdata.service.impl;
import com.fsnbigdata.service.api.SpecimenVideoService;
import org.springframework.roo.addon.layers.service.annotations.RooServiceImpl;
import com.fsnbigdata.domain.Specimen;
import com.fsnbigdata.domain.SpecimenVideo;
import com.fsnbigdata.repository.SpecimenVideoRepository;
import io.springlets.data.domain.GlobalSearch;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * = SpecimenVideoServiceImpl
 *
 * TODO Auto-generated class documentation
 *
 */
@RooServiceImpl(service = SpecimenVideoService.class)
@Service
@Transactional(readOnly = true)
public class SpecimenVideoServiceImpl implements SpecimenVideoService {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    private SpecimenVideoRepository specimenVideoRepository;

    /**
     * TODO Auto-generated constructor documentation
     *
     * @param specimenVideoRepository
     */
    @Autowired
    public SpecimenVideoServiceImpl(SpecimenVideoRepository specimenVideoRepository) {
        setSpecimenVideoRepository(specimenVideoRepository);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return SpecimenVideoRepository
     */
    public SpecimenVideoRepository getSpecimenVideoRepository() {
        return specimenVideoRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimenVideoRepository
     */
    public void setSpecimenVideoRepository(SpecimenVideoRepository specimenVideoRepository) {
        this.specimenVideoRepository = specimenVideoRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return SpecimenVideo
     */
    @Transactional
    public SpecimenVideo save(SpecimenVideo entity) {
        return getSpecimenVideoRepository().save(entity);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return SpecimenVideo
     */
    public SpecimenVideo findOne(Long id) {
        return getSpecimenVideoRepository().findOne(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return SpecimenVideo
     */
    public SpecimenVideo findOneForUpdate(Long id) {
        return getSpecimenVideoRepository().findOneDetached(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public List<SpecimenVideo> findAll(Iterable<Long> ids) {
        return getSpecimenVideoRepository().findAll(ids);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimen
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public Page<SpecimenVideo> findBySpecimen(Specimen specimen, GlobalSearch globalSearch, Pageable pageable) {
        return getSpecimenVideoRepository().findBySpecimen(specimen, globalSearch, pageable);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimen
     * @return Long
     */
    public long countBySpecimen(Specimen specimen) {
        return getSpecimenVideoRepository().countBySpecimen(specimen);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<SpecimenVideo> getEntityType() {
        return SpecimenVideo.class;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<Long> getIdType() {
        return Long.class;
    }
}
